#pragma once

#define BUILD_YEAR_CH0 (__DATE__[7])
#define BUILD_YEAR_CH1 (__DATE__[8])
#define BUILD_YEAR_CH2 (__DATE__[9])
#define BUILD_YEAR_CH3 (__DATE__[10])
 
#define BUILD_MONTH_FIRST_CHAR \
    (((__DATE__[0] == 'O') || (__DATE__[0] == 'N') || (__DATE__[0] == 'D')) ? '1' : '0')
 
#define BUILD_MONTH_CH1 \
    ((__DATE__[0] == 'J' && __DATE__[1] == 'a') ? '1' : \
     (__DATE__[0] == 'F') ? '2' : \
     (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r') ? '3' : \
     (__DATE__[0] == 'A' && __DATE__[1] == 'p') ? '4' : \
     (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[3] == 'y') ? '5' : \
     (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n') ? '6' : \
     (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l') ? '7' : \
     (__DATE__[0] == 'A' && __DATE__[1] == 'u') ? '8' : \
     (__DATE__[0] == 'S') ? '9' : \
     (__DATE__[0] == 'O') ? '0' : \
     (__DATE__[0] == 'N') ? '1' : \
     (__DATE__[0] == 'D') ? '2' : '?')

#define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
#define BUILD_DAY_CH1 (__DATE__[5])
 

#define BUILD_HOUR_CH0 (__TIME__[0])
#define BUILD_HOUR_CH1 (__TIME__[1])
#define BUILD_MIN_CH0 (__TIME__[3])
#define BUILD_MIN_CH1 (__TIME__[4])
#define BUILD_SEC_CH0 (__TIME__[6])
#define BUILD_SEC_CH1 (__TIME__[7])

#define COMPLETE_TIME_STR() { \
    BUILD_YEAR_CH2, BUILD_YEAR_CH3, \
    BUILD_MONTH_FIRST_CHAR, BUILD_MONTH_CH1, \
    BUILD_DAY_CH0, BUILD_DAY_CH1, '.', \
    BUILD_HOUR_CH0, BUILD_HOUR_CH1, BUILD_MIN_CH0, BUILD_MIN_CH1, \
    '\0' \
}

#define VERSION_MAJOR 1
#define VERSION_MINOR 0
